<?
session_start();
require("includes/constants.php");

if(!isset($_SESSION['userName'])){
	Header("Location: index.html");
	exit();
}
else
{
	$userId = $_SESSION['idUser'];
	$userName = $_SESSION['userName'];
	$userCompleteName = $_SESSION['userCompleteName'];
	$userType = $_SESSION['userType'];
}
?>
<!DOCTYPE HTML>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html" />
	<link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
	<style type="text/css" title="currentStyle">
			@import "js/datatables/css/demo_table_jui.css";
			@import "js/datatables/themes/smoothness/jquery-ui-1.8.4.custom.css";
			@import "js/datatables/css/TableTools_JUI.css";
	</style>
	<link href="css/css.css" rel="stylesheet" type="text/css" media="all" />
	
	<!-- JQuery Script -->
	<script type="text/javascript" src="js/jquery/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="js/jquery/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.core.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.tabs.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.dialog.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.mouse.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.draggable.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.position.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.ui.resizable.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.effects.core.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.effects.blind.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.effects.explode.js"></script>	
	<script type="text/javascript" src="js/jquery/jquery.ui.datepicker.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.maskedinput-1.2.2.min.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.validate.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.numeric.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.numericInt.js"></script>
	<script type="text/javascript" src="js/jquery/jquery.zweatherfeed.js"></script>
	
	<!-- Data Tables -->
	<script src="js/datatables/js/jquery.dataTables.js" type="text/javascript" ></script>
	<script src="js/datatables/js/jquery.dataTables.rowGrouping.js" type="text/javascript" ></script>
	<script src="js/datatables/media/js/jquery.jeditable.js" type="text/javascript"></script>
    <script src="js/datatables/media/js/jquery-ui.js" type="text/javascript"></script>
    <script src="js/datatables/media/js/jquery.validate.js" type="text/javascript"></script>
    <script src="js/datatables/media/js/jquery.dataTables.editable.js" type="text/javascript"></script>
    
	<script type="text/javascript" charset="utf-8" src="js/datatables/js/extras/ZeroClipboard.js"></script>
	<script type="text/javascript" charset="utf-8" src="js/datatables/js/extras/TableTools.js"></script>
	
	<!-- Config Script -->
	<script type="text/javascript" charset="utf-8" src="js/config.js"></script>
    
    <!-- Tools Script -->
    <script src="js/utils.js" type="text/javascript"></script>
</head>

<body>
	<div id="contenedor">
		<!-- Header -->
		<? include_once('layout/header.php');?>
		
		<!-- Body -->
		<?
		switch ($_REQUEST['screen']) {
			case 'usuarios':
				include_once('usuarios.php');
				break;
				
			case 'palomas':
				include_once('palomas.php');
				break;
				
			case 'carreras':
				include_once('carreras.php');
				break;
				
			case 'resultados':
				include_once('resultados.php');
				break;
				
			case 'ptosuelta':
				include_once('ptosuelta.php');
				break;
			
			default:
				include_once('layout/body.php');
				break;
		}
		?>
		
		<!-- Footer -->
		<? include_once('layout/footer.php');?>
	</div>
	
	<div id="configDialog"></div>

	<script type="text/javascript">
		$(document).ready(function() {
			$("#configDialog").dialog({
				autoOpen:false, 
				height:330, 
				width:540, 
				dialogClass:'no-close',
				open: function() {
					$('#configDialog').css('background','url(imagenes/fondo_texto.jpg)');
				}
			});
	
			//Add Click for All Buttons in Search Form
			$("#btnConfig").click( function(e) {
				 $.ajax({
				        type: 'POST',
				        url: 'usuariosAction.php',
				        data: 'actionOfForm=getConfig',
						dataType: 'json',
				        success: function(jsonObj)
				                            {
				        						joDataConfig = jsonObj;
				        						//Open Pop Dialog
				        						$('#configDialog').load('configPop.php').dialog('open');
				                            }
				        });
		    });
		});
	</script>

</body>

</html>